package com.stropheware.droidDefense;

import java.util.ArrayList;

import android.util.Log;

public class AchievementManager {
	public ArrayList<Achievement> achievements;
	
	public static final String TAG = "Achievement Manager";
	
	public static final String A_0 = "Welcome to the Machine"; //title
	public static final String A_0D = "Complete Story Mode"; //description
	
	public static final String A_1 = "Kill 'em All ...";
	public static final String A_1D = "Destroy 1,000 Enemies";
	
	public static final String A_2 = "... And let God Sort 'em Out";
	public static final String A_2D = "Destroy 10,000 Enemies";
	
	public static final String A_3 = "Canary in a Coal Mine";
	public static final String A_3D = "Complete 50 Rounds of Enemies";
	
	public static final String A_4 = "All a Man can do is Smile Back";
	public static final String A_4D = "Complete 500 Rounds of Enemies";
	
	public AchievementManager() {
		achievements = new ArrayList<Achievement>();
		achievements.add(new Achievement(0, A_0, A_0D, 1));
		achievements.add(new Achievement(1, A_1, A_1D, 1000));
		achievements.add(new Achievement(2, A_2, A_2D, 10000));
		achievements.add(new Achievement(3, A_3, A_3D, 50));
		achievements.add(new Achievement(4, A_4, A_4D, 500));
	}
	
	public void notifyEnemyDestroy() {
		if(achievements.get(1).increaseCompleted()) Log.d(TAG, "achievement unlocked");
		if(achievements.get(2).increaseCompleted()) Log.d(TAG, "achievement unlocked");
	}
	
	public void notifyRoundCompleted() {
		if(achievements.get(3).increaseCompleted()) Log.d(TAG, "achievement unlocked");
	}
}
